package com.demoproject.demo.service;

import org.junit.runner.notification.RunListener;
@RunListener.ThreadSafe
public class MyThread extends Thread {
    @Override
    public void run() {
        super.run();
        for (int i = 0; i < 1000; i++) {
            i++;
        }
    }

    public static class Run {
    public static void main(String[] args){
        Thread thread=new MyThread();
        thread.start();
        try {
            Thread.sleep(2000);
            Thread.currentThread().interrupted();
            System.out.println("stop1??"+thread.isInterrupted());
            System.out.println("stop2??"+thread.isInterrupted());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    public void s(){

    }

    }

}

